package com.ptl.bp.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.net.URI;
import java.util.List;

/**
 * 电池碳排放实体类
 * 描述：包含电池碳排放总量、各生命周期阶段碳排放、性能等级和研究报告等信息
 */
@Data
@Schema(description = "电池碳排放数据模型\n" +
        "Copyright © 2024 Circulor (for and on behalf of the Battery Pass Consortium). " +
        "This work is licensed under a Creative Commons License Attribution-NonCommercial 4.0 International (CC BY-NC 4.0).")
public class BatteryCarbonFootprint {

    @NotNull(message = "电池碳排放总量不能为空")
    @Schema(description = "电池的碳足迹，以每千瓦时电池在其预期使用寿命内提供的总能量所对应的二氧化碳当量千克数计算",required = true )
    private Double batteryCarbonFootprint;

    @NotNull(message = "各生命周期阶段碳排放不能为空")
    @Schema(description = "电池碳足迹占总电池碳足迹的比例，按生命周期阶段(原材料提取、电池生产、分销和回收)区分",required = true )
    private List<CarbonFootprintPerLifecycleStage> carbonFootprintPerLifecycleStage;

    @NotNull(message = "碳足迹性能等级不能为空")
    @Schema(description = "相关电池型号每个制造工厂对应的碳足迹性能等级。" +
            "EV、工业和LMT电池应带有明显、清晰易读且不可磨灭的标签，标明电池的碳足迹和电池型号对应的碳足迹性能等级。" +
            "性能等级应可通过电池护照访问。将开发有意义的性能等级数量(？)，其中A类是具有最低碳足迹生命周期影响的最佳等级。",required = true )
    private String carbonFootprintPerformanceClass;

    @NotNull(message = "碳足迹研究报告不能为空")
    @Schema(description = "支持碳足迹值的公开研究报告的网页链接",required = true )
    private String carbonFootprintStudy;

    /**
     * 各生命周期阶段碳排放实体类
     */
    @Data
    @Schema(description = "各生命周期阶段的碳排放")
    public static class CarbonFootprintPerLifecycleStage {
        
        @NotNull(message = "生命周期阶段不能为空")
        @Schema(
            description = "生命周期阶段的描述",
            required = true,
            allowableValues = {"RawMaterialExtraction", "MainProduction", "Distribution", "Recycling"}
        )
        private String lifecycleStage;

        @NotNull(message = "碳排放值不能为空")
        @Schema(
            description = "单个生命周期阶段的碳足迹",
            required = true
        )
        private Double carbonFootprint;
    }
}